<?php
/*
 * 手机客户端 学生信息列表
 * 2013-12-04
 */
 
include "inc/public_header.php";

include "func/user.php";				//用户信息处理函数

$zpuid		= $_REQUEST["zpuid"];

$reJson = array(); //构建返回值
$reJson["success"]='1';

//图片地址
$IMG_DEFAULT_PATH = "http://www.chinalaohu.com/images/news/";
$sql="select * from new_weituo_person where uid='".$zpuid."'";
$db->query($sql);
if(!$db->next_record()){
	echo json_encode(array("success"=>"0","errCode"=>"1"));
	die;
}

//学生个人信息
$sql="select a.nickname,a.ilogo_path,a.xuexiao_id,b.aname,a.uid,c.birthday,a.zhuanye,a.`year`,a.email,c.realname,a.praise
from new_weituo_person a 
LEFT JOIN new_weituo_xuexiao b on a.xuexiao_id=b.id
INNER JOIN user_base c on a.uid=c.uid
where a.good_student=1 and  a.uid='".$zpuid."'";
$db->query($sql);
$student=array();

while($db->next_record()){
	$student[]=array(
		"id"=>$db->f("uid")
		,"realname"=>(string)$db->f("realname")			//真实姓名
		,"nickname"=>(string)$db->f("nickname")			//昵称
		,"logo"=>(string)$db->f("ilogo_path")			//头像
		,"school"=>(string)$db->f("aname")				//学校
		,"birthday"=>(string)$db->f("birthday")			//生日
		,"zhuanye"=>(string)$db->f("zhuanye")			//专业
		,"year"=>(string)$db->f("year")					//学年
		,"email"=>(string)$db->f("email")				//邮箱
		,"praise"=>(string)$db->f("praise")				//荣誉
		
	);
	
}


$reJson["list"]=$student;

echo json_encode($reJson);

 ?>